package com.xbzl.cly_demo.controller;

import com.xbzl.cly_demo.dto.UsersDTO;
import com.xbzl.cly_demo.result.Result;
import com.xbzl.cly_demo.service.UsersService;
//import lombok.Builder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/auth")
public class UserController {

    @Autowired
    UsersService usersService;
    @PostMapping("/register")
    public Result<Long> register(@RequestBody UsersDTO usersDTO){
        long userId = usersService.register(usersDTO);
        return Result.success(userId);
    }

    //TODO 用户登录
    @PostMapping("/login")
    public Result login(){
        return Result.success();
    }

}
